Skip to main content

Create order

Details

Used to create a new giftcard order(s).

URL : <base_url>/reseller/orders

Method : POST

Authentication required : YES

Request parameters

In the request URL, provide the following parameter in the URL

ParameterTypeExampleDescription
cashier_pininteger123456required.
ordersarrayrequired.
orders.*.sender_namestringJon Snowoptional.
orders.*.receiver_namestringJane Snowoptional.
orders.*.receiver_phonestring+18767654321conditional.
orders.*.receiver_emailstringexample@example.comconditional.
orders.*.amountstring5000required.
orders.*.self_deliverstringtrueoptional.
orders.*.descriptorstringoptional.
orders.*.identifierstringoptional.
orders.*.contextstringall,merchant,categoryrequired.
orders.*.giftcardsarray[1,2]optional.

Receiver email required if phone is not present Receiver phone required if email is not present

Success Response

Code : 200 OK

Content :

{
"success": true,
"data": [
{
"sender_name": "Jon Snow",
"sender_phone": null,
"receiver_name": "Romario Hall",
"receiver_phone": "+18767728111",
"amount": 11000,
"ticket": true,
"self_deliver": true,
"identifier": null,
"descriptor": null,
"status": "complete",
"code": "445675018167",
"link": "https://staging.giftme.link/4kjzN?pin=7286",
"pin": "7286"
},
{
"sender_name": "Jon Snow",
"sender_phone": null,
"receiver_name": "Romario Hall",
"receiver_phone": "+18767728111",
"amount": 13000,
"ticket": false,
"self_deliver": false,
"identifier": null,
"descriptor": null,
"status": "complete",
"code": "200706492924",
"link": "https://staging.giftme.link/NDZle?pin=2475",
"pin": "2475"
}
]
}

Error Responses

Condition : Missing amount.

Code : 400 BAD REQUEST

Content :

{
"message": "The given data was invalid.",
"errors": {
"orders.0.amount": [
"The orders.0.amount field is required."
]
}
}

Condition : Missing receiver phone number.

Code : 400 BAD REQUEST

Content :

{
"message": "The given data was invalid.",
"errors": {
"orders.1.receiver_phone": [
"The orders.1.receiver_phone field is required."
]
}
}

Condition : Cashier.

Code : 400 BAD REQUEST

Content :

{
"message": "The given data was invalid.",
"errors": {
"cashier_pin": "Invalid cashier pin."
}
}